class Admin::BasetablesController < Admin::BaseController
    before_filter :is_administrator
  # GET /basetables
  # GET /basetables.xml
  def index
    @basetables = Basetable.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @basetables }
    end
  end

  # GET /basetables/1
  # GET /basetables/1.xml
  def show
    @basetable = Basetable.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @basetable }
    end
  end

  # GET /basetables/new
  # GET /basetables/new.xml
  def new
    @basetable = Basetable.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @basetable }
    end
  end

  # GET /basetables/1/edit
  def edit
    @basetable = Basetable.find(params[:id])
  end

  # POST /basetables
  # POST /basetables.xml
  def create
    @basetable = Basetable.new(params[:basetable])

    respond_to do |format|
      if @basetable.save
        flash[:notice] = 'Basetables was successfully created.'
        format.html { redirect_to admin_basetables_path }
        format.xml  { render :xml => @basetables, :status => :created, :location => @basetables }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @basetables.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /basetables/1
  # PUT /basetables/1.xml
  def update
    @basetable = Basetable.find(params[:id])

    respond_to do |format|
      if @basetable.update_attributes(params[:basetable])
        flash[:notice] = 'Basetables was successfully updated.'
        format.html { redirect_to admin_basetables_path  }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @basetables.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /basetables/1
  # DELETE /basetables/1.xml
  def destroy
    @basetables = Basetable.find(params[:id])
    @basetables.destroy

    respond_to do |format|
      format.html { redirect_to(basetables_url) }
      format.xml  { head :ok }
    end
  end
end
